<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <#include "../common/include_easyui.ftl">
    <#assign ctx = request.contextPath>

    <script type="text/javascript">
        var ctxPath = "${ctx}";
        $(function () {

            var configParam = '${configParamJson!'{}'}';
            configParam = JSON.parse(configParam);

            $("input[name='leftMenu'][value='"+configParam.leftMenu+"']").attr("checked",true);
            $("input[name='fontSize'][value='"+configParam.fontSize+"']").attr("checked",true);
            $("input[name='fontFamily'][value='"+configParam.fontFamily+"']").attr("checked",true);

            $('#saveBtn').bind('click', function () {
                saveData();
            });

        });

        function saveData() {

            var isValid = jQuery("#modifyForm").form('validate');
            if (!isValid) {
                jQuery("#modifyForm").form('enableValidation');
            } else {

                var saveURL = ctxPath + "/userPersonalController/modifyConfigParam?date=" + new Date() + "";
                var paramObj = jQuery("#modifyForm").serializeArray();

                jQuery.post(saveURL, paramObj, function (responseData) {

                    var code = responseData.code;
                    if (code == "200") {
                        $.messager.confirm('操作提示', '系统参数修改成功，是否刷新主界面！', function (tag) {
                            if (tag) {
                                var parentWin = window.parent;
                                parentWin.window.location.reload();

                            }
                        });

                    } else {
                        $.messager.alert('我的消息', "系统参数修改出错，原因 ：" + responseData.message, 'error');
                    }

                }, "json");
            }

        }
    </script>

    <style type="text/css">

        .modify-form {
            margin-top: 30px;
            position: absolute;
        }

        .modify-form > div {
            margin-left: 12%;
            margin-top: 40px;
            width: 88%;
            float: left;
            /*	margin-bottom:20px;
                 display: flex;
                justify-content:center; */
        }

        .modify-form > div > label {
            width: 160px;
            text-align: right;
            height: 40px;
            line-height: 40px;
            float: left;

        }

        .modify-form div input {
            max-width: 400px;
            height: 26px;
            width: 100%;
        }

        .modify-form .radioSpan {
            width: 50%;
            height: 40px;
            line-height: 40px;
            float: left;
            position: relative;
            border: 1px solid #95B8E7;
            background-color: #fff;
            display: inline-block;
            overflow: hidden;
            white-space: nowrap;
            margin: 0;
            padding: 0;
            -moz-border-radius: 5px 5px 5px 5px;
            -webkit-border-radius: 5px 5px 5px 5px;
            border-radius: 5px 5px 5px 5px;
            display: block;
        }

        .modify-form .radioSpan input {
            cursor: pointer;
            max-width: 30px;
            height: 20px;
            margin-top: 8px;
            margin-left: 20px;
        }

        .modify-form .radioSpan span {
            width: 100px;
            display: inline-block;
        }

    </style>
</head>

<body>
<form id="modifyForm" method="post" class="modify-form">
    <div>
        <label class="textbox-label textbox-label-before" for="leftMenu">左边菜单样式：</label>
        <div class="radioSpan">
            <span><input type="radio" name="leftMenu" value="tree"/>树状菜单</span>
            <span><input type="radio" name="leftMenu" value="accordion"/>折叠菜单</span>
        </div>
    </div>
    <div>
        <label class="textbox-label textbox-label-before" for="fontFamily">字体：</label>
        <div class="radioSpan">
            <span><input type="radio" name="fontFamily" value="楷体" />楷体</span>
            <span><input type="radio" name="fontFamily" value="SimSun" />宋体</span>
            <span><input type="radio" name="fontFamily" value="SimHei" />黑体</span>
            <span><input type="radio" name="fontFamily" value="Microsoft YaHei" />微软雅黑</span>
        </div>
    </div>

    <div>
        <label class="textbox-label textbox-label-before" for="fontSize">字体大小：</label>
        <div class="radioSpan">
            <span><input type="radio" name="fontSize" value="12" />12</span>
            <span><input type="radio" name="fontSize" value="14" />14</span>
            <span><input type="radio" name="fontSize" value="16" />16</span>
            <span><input type="radio" name="fontSize" value="18" />18</span>
        </div>
    </div>
    <div>
        <div style="padding-left:160px;float: left;">
            <a id="saveBtn" href="javascript:void(0);" class="easyui-linkbutton"
               data-options="iconCls:'icon-save'" style="height:35px;">确认修改</a>
        </div>
    </div>
</form>


</body>
</html>
